import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
// 引入图标
import {
	TrendCharts,
	Grid,
	List
  } from '@element-plus/icons-vue'

// 
import S_zc_r from "../router/S_zc"
import L_xin_r from "../router/L_xin"
import L_fulong_r from "../router/L_fulong"
import T_qiao_r from "../router/T_qiao"
import Z_han_r from "../router/Z_han"
import X_yulin_r from '../router/X_yulin';
// import {getCurrentInstance} from 'vue'


const routes: Array<RouteRecordRaw> = [

 
   //ym  页面之间的切换    田巧
	{
		path: '/ym',
		name: 'ym',
		component: () => import("../views/tq/views/ym/index.vue"),
		children: [
			{
			path: '/echarts',
			name: 'echarts',
			component: () => import("../views/tq/views/ym/ymchildrens/EchartsView.vue"),
			meta:{
				title:"数据展示",
				icon:TrendCharts
			}
		},
		{
			path: '/pay',
			name: 'pay',
			component: () => import("../views/tq/views/ym/ymchildrens/Paylist.vue"),
			meta:{
				title:"空",
				icon:Grid
			}
		},
		{
			path: '/userone',
			name: 'userone',
			component: () => import("../views/tq/views/ym/ymchildrens/UserOne.vue"),
			meta:{
				title:"医生信息",
				icon:List
			},
			children:[
				{
					path: '/userlist',
					name: 'userlist',
					component: () => import("../views/tq/views/ym/ymchildrens/UserList.vue"),
					meta:{
						classifyTitle:"医生信息",
						title:"信息列表"
					}
				},
				{
					path: '/userupdate',
					name: 'userupdate',
					component: () => import("../views/tq/views/ym/ymchildrens/UserUpdate.vue"),
					meta:{
						classifyTitle:"医生信息",
						title:"信息修改"
					}
				}
			]
		},
	
	]



	},


  ...S_zc_r,
  ...L_xin_r,
  ...L_fulong_r,
  ...T_qiao_r,
  ...Z_han_r,
  ...X_yulin_r
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})
router.beforeEach((to,form,next)=>{
    // if (to.path=="/Xyl") {
    //   let {proxy}:any=getCurrentInstance()
    //   proxy.$axios("/docin",{params:{id:7331}})
    //   .then()
    // }
    next()
})
export default router
